# $Id$
# Maintainer: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>

pkgbase=atkmm
pkgname=(atkmm atkmm-docs)
pkgver=2.24.2+1+gf30b47f
pkgrel=2
pkgdesc="C++ bindings for ATK"
url="http://www.gtkmm.org/"
arch=(i686 x86_64)
license=(LGPL)
depends=(atk glibmm)
makedepends=(git mm-common perl glibmm-docs)
_commit=f30b47ffcecdac60b3c890da08fbf485f891f5c9  # tags/2.25.1~6
source=("git+https://git.gnome.org/browse/atkmm#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
  cd $pkgbase
  git describe --tags | sed 's/-/+/g'
}

prepare() {
  cd $pkgbase
  NOCONFIGURE=1 ./autogen.sh
}

build() {
  cd $pkgbase
  ./configure --prefix=/usr --enable-maintainer-mode
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
  make
}

package_atkmm() {
  cd $pkgbase
  sed -i -e 's/^doc_subdirs/#doc_subdirs/' Makefile
  make DESTDIR="$pkgdir" install
}

package_atkmm-docs() {
  pkgdesc+=" (documentation)"
  depends=()

  cd $pkgbase
  make -C doc DESTDIR="$pkgdir" install
}
